package cn.findviewbydream.evil.main.enums;

/********************************************
 * 工程名：HebeuCS
 * 包名：cn.findviewbydream.evil.main.enums
 * 时间：16-11-2 下午6:30
 * 作者：白雨濃 evil
 * 邮箱：evilbai@foxmail.com
 * 内容：登录返回类型
 ********************************************/
public enum LoginType
{
    ADMIN(2, "管理员"),
    SUCCESS(1, "登录成功"),
    FAIL_PASSWORD_ERROR(-1, "密码错误"),
    FAIL_NULL(-2, "没有该账户"),
    ERROR(-3, "发生错误"),
    INBLACK(-10, "抱歉,您处在黑名单中,系统拒绝您的请求");

    private int index;
    private String state;


    LoginType(int index, String state)
    {
        this.index = index;
        this.state = state;
    }

    public static String getState(int index)
    {
        for (LoginType typeEnum : LoginType.values())
            if (typeEnum.getIndex() == index)
                return typeEnum.state;
        return null;
    }

    public int getIndex()
    {
        return index;
    }

    public String getState()
    {
        return state;
    }
}
